<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>
<script>
    <!--弱类型 语言不需要定义数据类型-->
    var a = 1;
    var b = "1";
    var c = true;
    var d = null;
    var e;
    var f = function () {
    };
    var g = [];
    var h = {};
    console.log(typeof a);
    console.log(typeof b);
    console.log(typeof c);
    console.log(typeof d);
    console.log(typeof e);
    console.log(typeof f);
    console.log(typeof g);
    console.log(typeof h);
    /* 字符串用单引号和双引号都可以*/
    var str1 = 'hello world';
    var str2 = "hello world";
    console.log(str1 == str2);
    /*
    * ==  和=== 的区别
    * == 把值转换成同一类型再比较
    * === 直接比较值
    * */
    var a = 1;
    var b = '1';
    console.log(a == b);// true
    console.log(a === b);// false

    //变量区分大小写
    var a = 1;
    var A = 2;
    console.log(a==A);
    //var 变量的名称 = 数据值 可以给同名的重新进行赋值(不会报错)
    var a = 2;
    console.log(a);
    a = 3;
    console.log(a);
</script>
</html>